﻿using linkPosWeb.Class;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


namespace linkPosWeb
{
    public partial class login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnGiris_Click(object sender, EventArgs e)
        {
            kullanicilar kul = new kullanicilar();
            kul._kullanici = txtUsername.Text;
            kul._pass = txtPass.Text;
            kul.login();
            int yetki = kul._yetki;
            switch (yetki)
            {
                case 1:
                    // megaadmin
                    Response.Redirect("linkyadmin/admin.aspx");
                    break;
                case 2:
                    // sistem supervizor
                    Response.Redirect("linkyadmin/spv.aspx");
                    break;
                case 3:
                    // bayi admin
                    Response.Redirect("bayiler/admin.aspx");
                    break;
                case 4:
                    // bayi supervizor
                    Response.Redirect("bayiler/spv.aspx");
                    break;
                case 5:
                    // firma super admin
                    Response.Redirect("firmalar/admin.aspx");
                    break;
                case 6:
                    // firma admin
                    Response.Redirect("firmalar/spv.aspx");
                    break;
                case 7:
                    // firma spv
                    
                    Response.Redirect("firmalar/spv.aspx");
                    break;

                default:
                    Response.Redirect("login.aspx");
                    break;
            }
        }
    }
}